package com.zcx.net;

/**
 * Created by hp on 2017/9/22.
 */
public class UrlHelper {

    private static final String HTTP_HEADER = "http://192.168.31.205:8080/v0.1/api/app_pay/alipays/";
//private static final String HTTP_HEADER = "http://192.168.31.205:8080/f/wxpay/orderPay2";
//    private static final String HTTP_HEADER = "https://api.91lezhua.com/api/";
//    private static final String HTTP_HEADER = "http://192.168.8.209:8000/api/";
//    private static final String HTTP_HEADER = "http://118.31.68.213:8001/api/";
//    private static final String HTTP_HEADER = "http://192.168.3.18:8000/api/";

    public static final String CONFIG = HTTP_HEADER + "Config/Detail";
    public static final String CONFIG_POP = HTTP_HEADER + "Config/Pop";
    public static final String SHARE_DETAIL = HTTP_HEADER + "Config/ShareDetail";

    public static final String APP_RANK = HTTP_HEADER + "App/Rank";
    public static final String CHECK_DETAIL = HTTP_HEADER + "App/CheckDetail";
    public static final String CHECK = HTTP_HEADER + "App/Check";
    public static final String TAB = HTTP_HEADER + "App/Tab";

    public static final String VERIFY_CODE = HTTP_HEADER + "User/VerifyCode";
    public static final String BINDING = HTTP_HEADER + "User/bind";
    public static final String LOGIN_IN = HTTP_HEADER + "User/login";
    public static final String LOGIN_OUT = HTTP_HEADER + "User/Logout";
    public static final String USER_INFO = HTTP_HEADER + "User/Info";
    public static final String CHANGE_NAME = HTTP_HEADER + "User/ChangeName";
    public static final String CATCH_RECORD = HTTP_HEADER + "User/CatchRecord";
    public static final String CATCHED_RECORD = HTTP_HEADER + "User/CatchedRecord";
    public static final String COIN = HTTP_HEADER + "User/Order";
    public static final String NOT_APPLE_SEND = HTTP_HEADER + "User/NotApplySend";
    public static final String APPLE_SEND = HTTP_HEADER + "User/ApplySendV2";
    public static final String MESSAGE = HTTP_HEADER + "User/Message";
    public static final String CONFIG_RECHARGE = HTTP_HEADER + "Config/RechargeItem";
    public static final String SEND_TIP = HTTP_HEADER + "User/SendTip";
    public static final String PROBLEM = HTTP_HEADER + "User/Problem";
    public static final String APPEAL = HTTP_HEADER + "User/Appeal";
    public static final String GET_DEFAULT_ADDRESS = HTTP_HEADER + "User/GetDefaultAddress";
    public static final String GET_ADDRESS_LIST = HTTP_HEADER + "User/GetAddressList";
    public static final String SET_DEFAULT_ADDRESS = HTTP_HEADER + "User/SetDefaultAddress";
    public static final String ADDRESS_SET = HTTP_HEADER + "User/AddressSet";
    public static final String ADDRESS_DEL = HTTP_HEADER + "User/AddressDel";
    public static final String DOLL_PACK = HTTP_HEADER + "User/DollPack";
//    public static final String UNIFIED_ORDER = HTTP_HEADER + "User/UnifiedOrder";
    public static final String UNIFIED_ORDER = HTTP_HEADER;
    public static final String QUERY_ORDER = HTTP_HEADER + "User/QueryOrder";
    public static final String CHANNELE_CATCHED_RECORD = HTTP_HEADER + "User/ChannleCatchedRecord";
    public static final String SET_VIDEO_URL = HTTP_HEADER + "User/SetVedioUrl";
    public static final String USER_INVITE = HTTP_HEADER + "User/UseInvite";
    public static final String USER_WELFARE = HTTP_HEADER + "User/UseWelfare";
    public static final String GET_INVITE = HTTP_HEADER + "User/GetInvite";
    public static final String USER_CATCHED = HTTP_HEADER + "User/UserCatched";
    public static final String USER_B_SIMPLE_INFO = HTTP_HEADER + "User/BSimpleInfo";
    public static final String USER_USERS = HTTP_HEADER + "User/Users";
    public static final String USER_EXCHANGE_DOLL_COIN = HTTP_HEADER + "User/ExchangeDollCoin";
    public static final String USER_EXCHANGE_COIN = HTTP_HEADER + "User/ExchangeCoin";
    public static final String USER_TICKET = HTTP_HEADER + "User/Ticket";

    public static final String ROOM_BANNER = HTTP_HEADER + "Room/Banner";
    public static final String NEW_ROOM_LIST_STATUS = HTTP_HEADER + "Room/ListStatusV3";
    public static final String ROOM_DETAIL = HTTP_HEADER + "Room/Detail";
    public static final String ROOM_DETAIL_V2 = HTTP_HEADER + "Room/DetailV2";
    public static final String ROOM_STATUS = HTTP_HEADER + "Room/Status";
    public static final String ROOM_SDLIST = HTTP_HEADER + "Room/SDList";

    public static final String CATCH_START = HTTP_HEADER + "Catch/Start";
    public static final String CATCH_START_PUSH = HTTP_HEADER + "Catch/StartPush";
    public static final String CATCH_END = HTTP_HEADER + "Catch/End";
    public static final String CATCH_DIRECT = HTTP_HEADER + "Catch/Direct";
    public static final String CATCH_PRESS = HTTP_HEADER + "Catch/Press";

    public static final String ADDRESS_REGION = HTTP_HEADER + "Address/Region";
    public static final String EXPRESS_TRACK = HTTP_HEADER + "Address/ExpressTrack";

    public static final String TOKEN_TCSIGN = HTTP_HEADER + "Token/TCSign";
    public static final String TOKEN_TCISIGN = HTTP_HEADER + "Token/TCISign";

    public static final String UPDATE = HTTP_HEADER + "Config/Update";
    public static final String CONFIG_SHARE = HTTP_HEADER + "Config/Share";

    public static final String VIDEO_DELAY = HTTP_HEADER + "app/VideoDelay";
    public static final String APP_POPS = HTTP_HEADER + "App/Pops";
    public static final String APP_MODULE = HTTP_HEADER + "App/Module";

    public static final String SYSTEM = "https://activity.91lezhua.com/maintain/index.js";

    public static String getLastUrl(String url) {
        StringBuilder stringBuilder = new StringBuilder(url);
        if (url.contains("?")) {
            stringBuilder.append("&av=").append(AppHelper.getAppVersionName());
        } else {
            stringBuilder.append("?av=").append(AppHelper.getAppVersionName());
        }
        stringBuilder.append("&imei=").append(IdHelper.getIMEI());
        stringBuilder.append("&sv=").append(DeviceHelper.getSDKIncremental());
        stringBuilder.append("&mt=").append(DeviceHelper.getSystemModel());
        stringBuilder.append("&pid=6");
        stringBuilder.append("&ns=").append(getNetType());
        stringBuilder.append("&c=").append(ChannelHelper.getChannel());
        return stringBuilder.toString();
    }

    private static int getNetType() {
        int type = NetWorkHelper.getAPNType();
        switch (type) {

            case 0:
                return 0;

            case 1:
                return 1;

            default:
                return 2;

        }
    }

}
